package dubbo.server.demo.service;

import com.alibaba.dubbo.config.annotation.Service;
import com.lyh.demo.api.DemoService;
import com.lyh.demo.api.entity.User;


@Service(version = "1.0.0")
public class DemoServiceImpl implements DemoService {
    @Override
    public String sayHello(String hello) {
        return hello;
    }

    @Override
    public User sayUser(User user) throws Exception {
        if (user == null || user.getName() == null) {
            throw new Exception("参数不能为空");
        }
        return user;
    }


    @Override
    public User sayUser() throws Exception {
        User user = new User();
        user.setAge("dasdasdsad");
        return user;
    }
}
